package com.etone;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Test<T> {

	
	double getPPI(double length, double height, double size){
		
		return Math.sqrt((length*length + height*height))/size;
		
	}
	
	
	@Override
	public int hashCode() {
		return "mane".hashCode();
	}

		

	public static void testImage(){
		
//		OutputStream os = new FileOutputStream("F:/");
		
//		Image image = Toolkit.getDefaultToolkit().getImage("F:/1.jpg");
//		
//		BufferedImage image1 = new BufferedImage(300, 200, BufferedImage.TYPE_INT_RGB);
//		
//		image1.getGraphics().drawImage(image, 0, 0, 333, 444, null);
//		
//		Set<String> s = null;
//		
//		TreeSet<String> ts = new TreeSet<String>(s);
		
	}
	
	public void testGetPPI()
	
	{
		System.out.println(getPPI(1280, 800, 14));
		System.out.println(getPPI(1024, 768, 9.7));
		System.out.println(getPPI(800, 480, 4));
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		testImage();
		
			List<String>  s =new ArrayList<String>();
			System.out.println(s.remove(new String("s")));
			
//		while(true){
//			System.out.println(new Random().nextInt(5));
//		}
		
//		System.out.println(3|6);
		
//		
//		int i = 0;
//		long t1 = System.currentTimeMillis();
//		for(int k=0;k<1E8;k++){
//			
//			if(k % 1E4 ==0)
//			i=i+3
//				;
//		}
//		long t2 = System.currentTimeMillis();
//		System.out.println(i + "\n" + (t2-t1));
//		System.out.println(1/((t2-t1)/1E11d));
		
//		Integer i = 10;
//		
//		System.out.println(i);
//		
		
		
//		String s = "a,a,a,";
//		System.out.println(s.split(",").length);
//		List<Integer> a = new ArrayList<Integer>();
//		List<Integer> b = new ArrayList<Integer>(a.size());
//		a.add(1);
//		a.add(2);
//		a.add(3);
//		
//		System.out.println(a.size() + " " + b.size());
//		Collections.copy(b, a);
//		
//		a.remove(0);
//		System.out.println(a.size() + " " +b.size());
		
/*
		while (true) {
			System.out.println(new Random().nextInt(10*60*1000));
		}
		
		String[] a = {"a","b","c","d"};
		System.out.println(System.getProperty("user.dir"));
		
		//new Test().testNotify(a[1]);
		String b = "��%s %s %<s %<s";
		
		*//**
		 * index will go back previous
		 *//*
		System.out.println(String.format("%2$s %s %<s %s", "a", "b", "c", "d"));
*/
	
	}
	
	public static void valuePasssb(StringBuilder sb, String name){
		sb.append(name);
	}
	public static void valuePass(Test.A a){
		 a.setK(a.getK() + 1);
	}
	
	static class A{
		private int k = 0;

		public int getK() {
			return k;
		}

		public void setK(int k) {
			this.k = k;
		}
		
	}
	
	
	
//	public static void valuePass(StringBuilder i,String name){
//		i.append(name);
//	}
	
	public void testList(){
		String[] B = null;
		List<String> b = new ArrayList<String>();
		System.out.println("b length is " + b.size() + B.length);
		String test[] = {"1", "9", "3", "7", "5", "6", "4", "8", "2", "4"};
		
		List<String> a = new ArrayList<String>();
		
		Arrays.sort(test);
		List<String> list = Arrays.asList(test);
		for(String s : list){
			if(Integer.parseInt(s)<5){
				a.add(s);
			}
		}
		
		a.addAll(list);
		
		
		for(String s : a){
			System.out.println(s);
		}
	}
	
	public void testNotify(){
		String s = new String("ssss");
		synchronized(s){
			System.out.println(s);
			try {
				s.wait();
				//notify();
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
	
}
